package com.example.springinit2.redis;

import com.example.springinit2.model.User;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class TestRedis {


  @Resource
  private RedisTemplate redisTemplate;


  public void Test(){
    redisTemplate.setValueSerializer(new
            Jackson2JsonRedisSerializer<>(User.class));

  }

}
